Thanks Simon. The link is useful and I will be using it.
I have the app sitting in the dev environment at the moment, what is interesting is that the URL is being built automatically when the xpage is called. And the bit I obviously do not like is that the path of the app and the server name are displayed for the world to see...